<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<style type="text/css">
body{font-size:12px;}
table{font-family:Arial,sans-serif;border-collapse:collapse;}
tr.border_bottom td {
  
  height:20px;
}

</style>
</head>
<body>
<table align="center" width="100%" >
	<tr>
	<td>
		<div class="mode">
			<br> order num: <?=$order->order_num?>
			<br> order time:
			<?=$order->order_time?>
			<br>
			<?php if($order->reservation !=NULL){?>
			<h4>
				<img src="<?=base_url()?>/resources/imgs/calendar.png"/> Réservation :
				<?=$order->reservation?>
			</h4>
			<?php }else{?>
			<h4>
				<img src="<?=base_url()?>/resources/imgs/flash.png" height="18"/>Date de Commande :
				<?=date('d-m-Y')?>
			</h4>
			<?php }?>
		</div>
		<div class="orders">
			<table align="center" width="100%">
				<tr bgColor="#eee">
					<td>QTY</td>
					<td>Num</td>
					<td>Options</td>
					<td style="text-align: right;">Total</td>
				</tr>
				<?php foreach ($order_details as $item):?>
				<tr class="border_bottom">
					<td style="font-size:15px;"><?php if($item->qty > 1){?><?=$item->qty?> x<?php }else{?>&nbsp;<?php }?>
					</td>
					<td style="font-size:16px;"><?=$item->product_num?>
					</td>
					<td><?php if($item->option!=NULL){?>
					<?=$item->option?>
					<?php }else{?>- - -<?php }?></td>
					<td style="text-align: right;"><?php echo $item->qty*($item->product_price+$item->additional_price) ;?> €</td>
				</tr>
				<?php endforeach;?>
			</table>
			<h4>
				Réduction:
				<?=$order->discount*100?>
				%
			</h4>
			<?php if($order->extra){?>
			<h4>
				Frais supplémentaire:
				<?=number_format($order->extra,1,'.','')?>
				€
			</h4>
			<?php }?>
			<h3>
				Total:
				<?php echo number_format($order->total*(1-$order->discount)+$order->extra,1,'.','');?>
				€
			</h3>
		</div>
		<hr>
		<?php if($order->order_type == 'delivery'):?>
		<h4>
			<img src="<?=base_url()?>/resources/imgs/car.png"/ height="20"> Livraison:
			<?=$order->delivery_time?>
		</h4>
		
		<?=$address->ring?>
		<br> 
		<?=($address->company !=null) ? $address->company : '-------'?>
		<br> 
		<?=$address->house_num?>
		<?=$address->address?>
		<br> 
		<?=$address->postal?>
		<?=$address->community?>
		<br> 
		<?=$address->tele?>
		<?php endif;?>
		<?php if($order->order_type == 'take away'):?>
		<h4>
			<img src="<?=base_url()?>/resources/imgs/bag.png" height="15"/> Plat à emporter:
			<?=$order->takeaway_time?>
		</h4>
		<h4>
			Magazin:
			<?=$order->shop->shop_name?> 
		</h4>
		Nom:
		<?=$member->firstname?>
		<?=$member->lastname?>
		<br> Téléphone:
		<?=$member->tel?>
		<?php endif;?>
		<br>
		<hr>
		Message: <br>
		<?=$order->message?>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>

		<div class="mode">
		<br> order num: <?=$order->order_num?>
			<br> order time:
			<?=$order->order_time?>
			<br>
			<?php if($order->reservation !=NULL){?>
			<h4>
				<img src="<?=base_url()?>/resources/imgs/calendar.png"/ > Réservation :
				<?=$order->reservation?>
			</h4>
			<?php }else{?>
			<h4>
				<img src="<?=base_url()?>/resources/imgs/flash.png" height="18"/> Date de Commande :
				<?=date('d-m-Y')?>
			</h4>
			<?php }?>
		</div>
		<div class="orders">
			<table align="center" width="100%">
				<tr bgColor="#eee">
					<td>QTY</td>
					<td>Num</td>
					<td>Options</td>
					<td style="text-align: right;">Total</td>
				</tr>
				<?php foreach ($order_details as $item):?>
				<tr class="border_bottom">
					<td><?php if($item->qty > 1){?><?=$item->qty?> x<?php }else{?>&nbsp;<?php }?>
					</td>
					<td style="font-size:14px;font-weight:bold;"><?=$item->product_num?>
					</td>
					<td><?php if($item->option !=NULL){?>
					<?=$item->option?>
					<?php }else{?>- - -<?php }?></td>
					<td style="text-align: right;"><?php echo $item->qty*($item->product_price+$item->additional_price) ;?> €</td>
				</tr>
				<?php endforeach;?>
			</table>
			<h4>
				Réduction:
				<?=$order->discount*100?>
				%
			</h4>
			<?php if($order->extra){?>
			<h4>
				Frais supplémentaire:
				<?=number_format($order->extra,1,'.','')?>
				€
			</h4>
			<?php }?>
			<h3>
				Total:
				<?php echo number_format($order->total*(1-$order->discount)+$order->extra,1,'.','');?>
				€
			</h3>
		</div>
		<hr>
		<?php if($order->order_type == 'delivery'):?>
		<h4>
			<img src="<?=base_url()?>/resources/imgs/car.png" height="20" /> Livraison:
			<?=$order->delivery_time?>
		</h4>
		
		<?=$address->ring?>
		<br> 
		<?=($address->company !=null) ? $address->company : '-------'?>
		<br>
		<?=$address->house_num?>
		<?=$address->address?>
		<br> 
		<?=$address->postal?>
		<?=$address->community?>
		<br>
		<?=$address->tele?>
		<?php endif;?>
		<?php if($order->order_type == 'take away'):?>
		<h4>
			<img src="<?=base_url()?>/resources/imgs/bag.png" height="15"/> Plat à emporter:
			<?=$order->takeaway_time?>
		</h4>
		<h4>
			Magazin:
			<?=$order->shop->shop_name?>
		</h4>
		Nom:
		<?=$member->firstname?>
		<?=$member->lastname?>
		<br> Téléphone:
		<?=$member->tel?>
		<?php endif;?>
		<br>
		<hr>
		Message: <br>
		<?=$order->message?>
		<td>
		</tr>
	</table>
</body>
</html>
